const axios = require('axios');
const baseUrl = require('../utils/config.js').baseUrl;
const Service = require('egg').Service;
class filmService extends Service {
    async playing() {
        const res = await axios.get(baseUrl+'/film/now-playing',{
            params: this.ctx.query
        });
        return res.data;
    }  
    async coming() {
        const res = await axios.get(baseUrl+'/film/coming-soon',{
            params: this.ctx.query
        });
        return res.data;
    }  
    async detail() {
        const {id} = this.ctx.params;
        const res = await axios.get(baseUrl+'/film/'+id);
        return res.data;
    }
}

module.exports = filmService;